home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: The RISC OS Graphics CD / Acorn User: The RISC OS Graphics CD.iso / utilities / iconhunt / _iconhunt / technical < prev    next >
Encoding:
Text File  |  2000-12-31  |  918 b   |  27 lines

  1. Heap Management:
  2.  
  3. You must allocate 4 bytes for a header record (no. 0)
  4. the number of records currently is stored in !heap%
  5.  
  6. FNlocate(record%)
  7.  Returns the memory pointer for record%
  8. FNcreate(size%)
  9.  Allocates memory for new record
  10. PROCdelete(record%)
  11.  Deletes record% and shrinks heap if possible
  12.  
  13. The size of the record% is stored at !FNlocate(record%)
  14. You can maintain this value if you want (I havn't needed to ... yet)
  15. Try to release all blocks when you've finished or an error occurs.
  16.  
  17. Binary Tree:
  18.  
  19. PROCputintree(name$)
  20.  name$ is name to enter (e.g. the sprite name)
  21. FNfindintree(name$)
  22.  returns record% pointer if exists or 0 if it's non-existent
  23.  
  24. Internall the binary tree uses direct pointers (not record number pointers)
  25. This speeds things up by about 60% for !IconHunt but makes things less flexible
  26. especially if you want to use relocatable blocks.  See TechFile for the slower
  27. but more flexible routines.